

set more off
mat drop _all






use "$path_data/data/temp/attrition_check.dta", clear




gen have_psc_math = cond(!missing(Mathematics),1,0)




gen pts_pre_miss = pts_pre
gen pts_dum_miss = 0
replace pts_dum_miss = 1 if pts_pre == .
sum pts_pre
replace pts_pre_miss = r(mean) if pts_pre == .



*** Dropout of PSC


twoway (hist pts_pre if treatment == 1 & have_psc_math == 1, frac lcolor(gs12) fcolor(gs12) width(10) start(0)) ///
(hist pts_pre if treatment == 0 & have_psc_math == 1, frac fcolor(none) lcolor(black) width(10) start(0)), ///
legend(order(1 "Treatment" 2 "Control") pos(11) ring(0) col(1)) ///
xlabel(0(10)100, labsize(vsmall) valuelabel) xtitle("Baseline PTS-II") graphregion(color(white))

graph export "$pardir/figureG2.pdf", replace as(pdf)




